package gamefw.gameplugin;


/**
 * The Class GameLogic implements the actual rules for a specific game.
 * It is responsible to implement the rules to select the player for the next turn,
 * to decide when the game is over and declare the winner. It also must define the number
 * players that are required for the particular game rules. 
 */
public abstract class AbstractGameLogic implements UIEventListener {

	/**
	 * Gets the number of players that are required for this particular game.
	 *
	 * @return the number of players that are required for this particular game.
	 */
	public abstract int getPlayersNumber();

	/**
	 * Gets the player that has won the game or null if the game is not over.
	 *
	 * @return the winner of the game
	 */
	public abstract IPlayer getWinner();

	/**
	 * Gets the player that should play the next turn.
	 *
	 * @return the next player
	 */
	public abstract IPlayer getNextPlayer();

	/**
	 * Checks if the game is over.
	 *
	 * @return true, if is game over
	 */
	public abstract boolean isGameOver();
	
	/**
	 * Main game loop should be implemented in this method.
	 */
	public abstract void gameLoop();

}